<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.springside.modules.security.springsecurity.SpringSecurityUtils" %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Web 帐号管理</title>
	<%@ include file="/common/meta.jsp" %>
	<link href="${ctx}/css/style.css" type="text/css" rel="stylesheet"/>
	<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
	<script src="${ctx}/js/table.js" type="text/javascript"></script>
</head>

<body style="margin-top:20px;">

<div id="content">
	<div id="message"><s:actionmessage theme="mytheme"/></div>
	<form id="mainForm" action="user.action" method="post">
		<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
		<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
		<input type="hidden" name="page.order" id="order" value="${page.order}"/>

		<div id="filter">
			<h1><img src="${ctx}/skin/images/frame/icon22.gif" align="absbottom"/>&nbsp;用户管理列表</h1><br>
			<div class="ct_bg">
				登录名: <input type="text" name="filter_EQS_loginName" value="${param['filter_EQS_loginName']}" size="9"/>
				姓名或Email: <input type="text" name="filter_LIKES_name_OR_email"
								 value="${param['filter_LIKES_name_OR_email']}" size="9"/>
				<input class="button" type="button" value="搜索" onclick="search();"/>
			</div>
		</div>
		<div style="margin-top:10px;">
			<table width="95%" border="0" cellpadding="5" cellspacing="0" id="contentTable">
				<tr>
					<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('loginName','asc')">登录名</a></th>
					<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('name','asc')">姓名</a></th>
					<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif"><a href="javascript:sort('email','asc')">电邮</a></th>
					<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif">角色</th>
					<th bgcolor="#F5F5F5" background="${ctx}/skin/images/frame/wbg.gif">操作</th>
				</tr>

				<s:iterator value="page.result">
					<tr onmousemove="javascript:this.bgColor='#f2fafd';" onmouseout="javascript:this.bgColor='#FFFFFF';">
						<td align="center">${loginName}&nbsp;</td>
						<td align="center">${name}&nbsp;</td>
						<td align="center">${email}&nbsp;</td>
						<td align="center">${roleNames}&nbsp;</td>
						<td align="center">&nbsp;
							<security:authorize ifAnyGranted="A_VIEW_USER">
								<security:authorize ifNotGranted="A_MODIFY_USER">
									<a href="user!input.action?id=${id}">查看</a>&nbsp;
								</security:authorize>
							</security:authorize>

							<security:authorize ifAnyGranted="A_MODIFY_USER">
								<a href="user!input.action?id=${id}">修改</a>&nbsp;
								<a href="user!delete.action?id=${id}">删除</a>
							</security:authorize>
					  </td>
					</tr>
				</s:iterator>
		  </table>
		</div>

		<div class="page">
			第${page.pageNo}页, 共${page.totalPages}页
			<a href="javascript:jumpPage(1)">首页</a>
			<s:if test="page.hasPre"><a href="javascript:jumpPage(${page.prePage})">上一页</a></s:if>
			<s:if test="page.hasNext"><a href="javascript:jumpPage(${page.nextPage})">下一页</a></s:if>
			<a href="javascript:jumpPage(${page.totalPages})">末页</a>

			<security:authorize ifAnyGranted="A_MODIFY_USER">
				<a href="user!input.action">增加新用户</a>
			</security:authorize>
		</div>
	</form>
</div>

</body>
</html>
